Skip to content

Test rewrites #9037

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 29, 2020
Merged

Test rewrites #9037

merged 9 commits into from
May 29, 2020

Conversation

liufengyun
Copy link
Contributor

Test rewrites to avoid accidental regression

Related: #9002 #8982

@@ -197,7 +197,6 @@ object Scanners {
val noindentSyntax =
ctx.settings.noindent.value
|| ctx.settings.oldSyntax.value
|| migrateTo3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think having -source 3.0-migrate imply -noindent is intentional: it should allow existing weirdly formatted scala 2 code to compile /cc @odersky.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is that if a user run compiler with -rewrite, then it's impossible to compile the code again.

It's discovered when we actually compile the rewritten code in the following test:

compileFile("tests/rewrites/rewrites.scala", scala2CompatMode.and("-rewrite", "-indent"))

Copy link
Member

@smarter smarter May 26, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that example I think -indent needs to take precedence over migrateTo3 and force indentation to be on.

@liufengyun
Copy link
Contributor Author

@smarter Could you have a look at the changes again?

@liufengyun liufengyun merged commit af37d64 into scala:master May 29, 2020
@liufengyun liufengyun deleted the test-rewrites branch May 29, 2020 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants